function [result] = read5(input,dim1,dim2,dim3,dim4,dim5)

    result(dim1,dim2,dim3,dim4,dim5)=0.0;
    a=dim5*dim4*dim3*dim2;
    b=dim5*dim4*dim3;
    c=dim5*dim4;
    d=dim5;
    for h=1:dim1
        for i=1:dim2
            for j=1:dim3
                for k=1:dim4
                    for m=1:dim5
                        result(h,i,j,k,m)=input(a*(h-1)+b*(i-1)+c*(j-1)+d*(k-1)+m);
                    end
                end
            end
        end
    end

end